<!DOCTYPE html>
<html style="overflow: auto;">

	<head>
		<meta charset="utf-8">
		<title>setting</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="../../css/common.css" />
		<link rel="stylesheet" type="text/css" href="../../css/lib/mui/mui.css">
		<link rel="stylesheet" type="text/css" href="../../css/common/animate.css">
		<link rel="stylesheet" type="text/css" href="../../css/common/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/mvc/contact/contactInfo.css">
		<style>
			.mui-table-view::after {
				background-color: #dddddd;
			}
			
			.mui-table-view::before {
				background-color: #dddddd;
			}
			
			.mui-table-view-cell::after {
				background-color: #dddddd;
			}
		</style>
	</head>

	<body style="background-color: #FFFFFF;height: 100%;width: 100%;position: absolute;overflow: auto;">
		<div style="background-repeat: no-repeat;height: 60%;background-color: #ff0000;"></div>
		<div style="background-repeat: no-repeat;height: 40%;background-color: #FFFFFF;"></div>
		<div class="animated slideInUp" style='animation-duration: 0.7s;position:absolute;top:90px;width:100%; height:500px; background: #FFFFFF; border-top-left-radius:50% 50px; border-top-right-radius:50% 50px ;height: 60%;'>
			<div style="width: 90px;height: 90px;border-radius: 45px;background-color: #FFFFFF;margin:0 auto;margin-top: -45px; text-align: center;">
				<img width="86px" height="86px" src="../../img/common/me.jpg" style="margin:0 auto;margin-top: 2px;border-radius: 42px;" />
				<div style="font-size: 18px;" id="user_name"></div>
			</div>
			<div style="font-size: 13px;margin: 0 auto;margin-top:22px;text-align: center;color: #999999;" id="orgname"></div>
		</div>
		<ul class="mui-table-view animated slideInUp" style="animation-duration: 0.9s;position: absolute;top: 200px;left: 0px;width: 100%;">
			<li class="mui-table-view-cell" style="height: 43px">
				<a style="padding: 0px;height: 43px">
					<span style="float: left; margin-top: 7px; margin-left: 15px;">
						<img src="../../img/common/message.png" width="26px"/>
					</span>
					<span style="padding-left: 15px; margin-top: 0px; padding-top: 0px; line-height: 40px;font-size: 16px;color: #333333" id="username">
					</span>

				</a>
			</li>
			<li class="mui-table-view-cell" style="height: 43px">
				<a style="padding: 0px;height: 43px">
					<span style="float: left; margin-top: 7px; margin-left: 15px;">
						<img src="../../img/common/message.png" width="26px"/>
					</span>
					<span style="padding-left: 15px; margin-top: 0px; padding-top: 0px; line-height: 40px;font-size: 16px;color: #333333" id="contact">
					</span>

				</a>
			</li>
		</ul>
		<ul class="mui-table-view animated slideInUp" style="animation-duration: 0.9s;position: absolute;top: 300px;left: 0px;width: 100%;">
			<li id="setting"  class="mui-table-view-cell" style="height: 43px">
				<a class="mui-navigate-right" style="padding: 0px;height: 43px">
					<span style="float: left; margin-top: 7px; margin-left: 15px;">
						<img src="../../img/common/setting.png" width="26px"/>
					</span>
					<span style="padding-left: 15px; margin-top: 0px; padding-top: 0px; line-height: 40px;font-size: 16px;color: #333333">
						修改信息
					</span>

				</a>
			</li>
			<li id="pointQuery"  class="mui-table-view-cell" style="height: 43px">
				<a class="mui-navigate-right" style="padding: 0px;height: 43px">
					<span style="float: left; margin-top: 7px; margin-left: 15px;">
						<img src="../../img/common/message.png" width="26px"/>
					</span>
					<span style="padding-left: 15px; margin-top: 0px; padding-top: 0px; line-height: 40px;font-size: 16px;color: #333333">
						积分查询
					</span>
				</a>
			</li>
		</ul>
		<div class="animated slideInUp" style="position:absolute;width:auto;animation-duration: 1s;top:460px;margin: 0 auto;left:10px;right: 10px;">
			<button id="exit" type="button" class="mui-btn mui-btn-danger" style="width: 100%;height: 42px;border-radius: 21px;">
				安全退出
			</button>
		</div>
		
		<script type="text/javascript" src="../../js/common/config.js" ></script>
		<script type="text/javascript" src="../../js/lib/mui/mui.js"></script>
		<script type="text/javascript" src="../../js/lib/jquery/jquery.js"></script>
		<script type="text/javascript" src="../../js/common/common.js" ></script>
		<script type="text/javascript" src="../../js/lib/jquery/jquery.json.js" ></script> 
		<script>
			mui.init({
				swipeBack:false, //启用右滑关闭功能
				keyEventBind: {
					backbutton: true  //关闭back按键监听
				}
			}); 
			var userid;
			mui.plusReady(initSomething);
			function initSomething(){
				common.utils.confirmLoginOut();
				$("#exit").on("tap",function(){//退出
					var btnArray = ['是', '否'];  
					mui.confirm('您是否要安全退出系统？', '云党建', btnArray, function(e) {  
		                    if (e.index == 0) {  
		                      	plus.runtime.quit();  
		                      	clearUser();
		                    }  
		        	})
				});
				userid = common.utils.getUserId();
				initData(userid);
			}
			function initData(userid){
				mui.ajax(ctx+"mobile/common/getUser?userid="+userid,{
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；	              
					success:function(data){
				       	if(data&&data.success){
				       		$("#username").html(data.data.name);
				       		$("#contact").html(data.data.mobile);
				       		$("#setting").on("tap",function(){//设置
								var view = plus.webview.create("setting.html", "setting.html", {},{useruuid:data.data.id,mobile:data.data.mobile,type:data.data.type,idcard:data.data.idcard});
								plus.webview.show(view, "slide-in-right", "350ms", function() {}, false);
							});
							$("#pointQuery").on("tap",function(){//积分查询
								var view = plus.webview.create("pointQuery.html", "pointQuery.html", {},{});
								plus.webview.show(view, "slide-in-right", "350ms", function() {}, false);
							});
				      	}else{
				      		alert('服务器异常链接失败!');
				      	}
					},
					error:function(xhr,type,errorThrown){
						alert('服务器异常链接失败!');
					}
				});

			}
			//清理用户信息
			function clearUser(){
				plus.storage.removeItem("username");
				plus.storage.removeItem("password");
			}
			
			
		</script>
	</body>

</html>